﻿namespace Devonline.Core
{
    /// <summary>
    /// database endpoint configuration
    /// </summary>
    public class DatabaseEndpoint : Endpoint, IDatabaseEndpoint
    {
        /// <summary>
        /// database type
        /// </summary>
        public DatabaseType DatabaseType { get; set; }
        /// <summary>
        /// database connection string
        /// </summary>
        public string ConnectionString { get; set; }
        /// <summary>
        /// end point default database
        /// </summary>
        public string Database { get; set; }
        /// <summary>
        /// end point default database table name
        /// </summary>
        public string DataTable { get; set; }
        /// <summary>
        /// 限制查询或写入的行数, 默认 0, 即不限制
        /// </summary>
        public int? Limit { get; set; }
        /// <summary>
        /// 分页的偏移量, 配合 Limit 设置
        /// </summary>
        public int? Offset { get; set; }
        /// <summary>
        /// 分页的页码
        /// </summary>
        public int? PageIndex { get; set; }
        /// <summary>
        /// 分页的页大小, 配合 PageIndex 设置
        /// </summary>
        public int? PageSize { get; set; }
        /// <summary>
        /// 数据访问的总数目, 不需要配置, 数据处理过程中记录用的
        /// </summary>
        public long? Total { get; set; }
    }
}
